<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon.ico">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://durianyang.gitee.io/blog').hostname,
    root: '/blog/',
    scheme: 'Gemini',
    version: '7.6.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="plantUML插件安装首先在IDEA上安装搜索plantUML插件install，然后再安装 graphviz">
<meta name="keywords" content="UML类图,工具">
<meta property="og:type" content="article">
<meta property="og:title" content="使用idea插件plantUML画UML类图">
<meta property="og:url" content="https:&#x2F;&#x2F;durianyang.gitee.io&#x2F;blog&#x2F;2019&#x2F;12&#x2F;16&#x2F;%E4%BD%BF%E7%94%A8idea%E6%8F%92%E4%BB%B6plantUML%E7%94%BBUML%E7%B1%BB%E5%9B%BE&#x2F;index.html">
<meta property="og:site_name" content="Durian blog">
<meta property="og:description" content="plantUML插件安装首先在IDEA上安装搜索plantUML插件install，然后再安装 graphviz">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http:&#x2F;&#x2F;m.qpic.cn&#x2F;psb?&#x2F;V14N9n6L1YfzpS&#x2F;HwECIfjTOz4o3Eu8Vkb58DTO5EdHBeGZ4IQLjvQptXg!&#x2F;b&#x2F;dAUBAAAAAAAA&amp;bo&#x3D;JQOBAgAAAAADB4c!&amp;rf&#x3D;viewer_4">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;private-field.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;private-method.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;protected-field.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;protected-method.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;package-private-field.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;package-private-method.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;public-field.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;public-method.png">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;imgw&#x2F;class-diagram-dlkb0dnq.webp">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;imgw&#x2F;class-diagram-ym813clr.webp">
<meta property="og:image" content="https:&#x2F;&#x2F;s.plantuml.com&#x2F;imgw&#x2F;class-diagram-f9tbsmlt.webp">
<meta property="og:image" content="http:&#x2F;&#x2F;a1.qpic.cn&#x2F;psc?&#x2F;V14N9n6L1YfzpS&#x2F;7o.xLwnHK.dZGyBaILrm9xDzVMHaUNZg7.kBOION*sjftXZdZAFeWiaeGMCm0XMvPNQYtTYgTMIaxfu6azHUmYutctME4wkB.QqMz6tPMJM!&#x2F;c&amp;ek&#x3D;1&amp;kp&#x3D;1&amp;pt&#x3D;0&amp;bo&#x3D;GgOFAgAAAAADF6w!&amp;tl&#x3D;1&amp;vuin&#x3D;1323807496&amp;tm&#x3D;1576483200&amp;sce&#x3D;60-2-2&amp;rf&#x3D;viewer_4">
<meta property="og:updated_time" content="2019-12-16T07:43:39.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http:&#x2F;&#x2F;m.qpic.cn&#x2F;psb?&#x2F;V14N9n6L1YfzpS&#x2F;HwECIfjTOz4o3Eu8Vkb58DTO5EdHBeGZ4IQLjvQptXg!&#x2F;b&#x2F;dAUBAAAAAAAA&amp;bo&#x3D;JQOBAgAAAAADB4c!&amp;rf&#x3D;viewer_4">

<link rel="canonical" href="https://durianyang.gitee.io/blog/2019/12/16/%E4%BD%BF%E7%94%A8idea%E6%8F%92%E4%BB%B6plantUML%E7%94%BBUML%E7%B1%BB%E5%9B%BE/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>使用idea插件plantUML画UML类图 | Durian blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Durian blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">生活又不是热血动漫</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/blog/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/blog/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/Durianyang" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://durianyang.gitee.io/blog/2019/12/16/%E4%BD%BF%E7%94%A8idea%E6%8F%92%E4%BB%B6plantUML%E7%94%BBUML%E7%B1%BB%E5%9B%BE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.jpg">
      <meta itemprop="name" content="Durian">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Durian blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          使用idea插件plantUML画UML类图
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-12-16 15:43:39 15:43:39" itemprop="dateCreated datePublished" datetime="2019-12-16T15:43:39+08:00">2019-12-16 15:43:39</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index">
                    <span itemprop="name">笔记</span>
                  </a>
                </span>
            </span>

          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h4 id="plantUML插件安装"><a href="#plantUML插件安装" class="headerlink" title="plantUML插件安装"></a>plantUML插件安装</h4><p>首先在IDEA上安装搜索plantUML插件install，然后再安装 graphviz </p>
<a id="more"></a>

<h4 id="一、UML类图的简单绘制"><a href="#一、UML类图的简单绘制" class="headerlink" title="一、UML类图的简单绘制"></a>一、UML类图的简单绘制</h4><blockquote>
<p> 简单示例:</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">title 类图 </span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line">scale <span class="number">1.5</span> <span class="comment">//生成图片倍数</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">/<span class="string">'组合关系(composition)'</span>/</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Human</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line">    - Head mHead;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line">    - Heart mHeart;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line">    ..</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">10</span></pre></td><td class="code"><pre><span class="line">    - CreditCard mCard;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">11</span></pre></td><td class="code"><pre><span class="line">    --</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">12</span></pre></td><td class="code"><pre><span class="line">    + <span class="function"><span class="keyword">void</span> <span class="title">travel</span><span class="params">(Vehicle vehicle)</span></span>;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">13</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">14</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">15</span></pre></td><td class="code"><pre><span class="line">Human *-up- Head : contains &gt;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">16</span></pre></td><td class="code"><pre><span class="line">Human *-up- Heart : contains &gt;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">17</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">18</span></pre></td><td class="code"><pre><span class="line">/<span class="string">'聚合关系(aggregation)'</span>/</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">19</span></pre></td><td class="code"><pre><span class="line">Human o-left- CreditCard : owns &gt;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">20</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">21</span></pre></td><td class="code"><pre><span class="line">/<span class="string">'依赖关系(dependency)'</span>/</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">22</span></pre></td><td class="code"><pre><span class="line">Human .down.&gt; Vehicle : dependent</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">23</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">24</span></pre></td><td class="code"><pre><span class="line">/<span class="string">'关联关系(association'</span>/</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">25</span></pre></td><td class="code"><pre><span class="line">Human -down-&gt; Company : associate</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">26</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">27</span></pre></td><td class="code"><pre><span class="line">/<span class="string">'继承关系(extention)'</span>/</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">28</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">interface</span> <span class="title">IProgram</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">29</span></pre></td><td class="code"><pre><span class="line">    + <span class="function"><span class="keyword">void</span> <span class="title">program</span><span class="params">()</span></span>;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">30</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">31</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Programmer</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">32</span></pre></td><td class="code"><pre><span class="line">    + <span class="function"><span class="keyword">void</span> <span class="title">program</span><span class="params">()</span></span>;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">33</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">34</span></pre></td><td class="code"><pre><span class="line">Programmer -left-|&gt; Human : extend</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">35</span></pre></td><td class="code"><pre><span class="line">Programmer .up.|&gt; IProgram : implement</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">36</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>

<p><img src="http://m.qpic.cn/psb?/V14N9n6L1YfzpS/HwECIfjTOz4o3Eu8Vkb58DTO5EdHBeGZ4IQLjvQptXg!/b/dAUBAAAAAAAA&bo=JQOBAgAAAAADB4c!&rf=viewer_4" alt=""></p>
<h5 id="类之间的关系表示："><a href="#类之间的关系表示：" class="headerlink" title="类之间的关系表示："></a>类之间的关系表示：</h5><ul>
<li>泛化，Generalization：&lt;|– </li>
<li>关联，Association：&lt;– </li>
<li>组合，Composition：*– </li>
<li>聚合，Aggregation：o– </li>
<li>实现，Realization：&lt;|.. </li>
<li>依赖，Dependency：&lt;.. </li>
</ul>
<blockquote>
<p>关系上的标识: 在关系之间使用标签来说明时, 使用 <code>:</code>后接标签文字 , 对元素的说明，可以在每一边使用 <code>&quot;&quot;</code> 来说明 </p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">Class01 <span class="string">"1"</span> *-- <span class="string">"many"</span> Class02 : contains</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">Class03 o-- Class04 : aggregation</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line">Class05 --&gt; <span class="string">"1"</span> Class06</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<h5 id="添加方法："><a href="#添加方法：" class="headerlink" title="添加方法："></a>添加方法：</h5><blockquote>
<p>interface IProgram {<br>    + void program();<br>}</p>
</blockquote>
<h5 id="定义可访问性"><a href="#定义可访问性" class="headerlink" title="定义可访问性"></a>定义可访问性</h5><table>
<thead>
<tr>
<th><strong>Character</strong></th>
<th><strong>Icon for field</strong></th>
<th><strong>Icon for method</strong></th>
<th><strong>Visibility</strong></th>
</tr>
</thead>
<tbody><tr>
<td>-</td>
<td><img src="https://s.plantuml.com/private-field.png" alt="img"></td>
<td><img src="https://s.plantuml.com/private-method.png" alt="img"></td>
<td>private</td>
</tr>
<tr>
<td>#</td>
<td><img src="https://s.plantuml.com/protected-field.png" alt="img"></td>
<td><img src="https://s.plantuml.com/protected-method.png" alt="img"></td>
<td>protected</td>
</tr>
<tr>
<td>~</td>
<td><img src="https://s.plantuml.com/package-private-field.png" alt="img"></td>
<td><img src="https://s.plantuml.com/package-private-method.png" alt="img"></td>
<td>package private</td>
</tr>
<tr>
<td>+</td>
<td><img src="https://s.plantuml.com/public-field.png" alt="img"></td>
<td><img src="https://s.plantuml.com/public-method.png" alt="img"></td>
<td>public</td>
</tr>
</tbody></table>
<h5 id="抽象类与接口"><a href="#抽象类与接口" class="headerlink" title="抽象类与接口"></a>抽象类与接口</h5><p> 用关键字<code>abstract</code>或<code>abstract class</code>来定义抽象类。抽象类用斜体显示。 也可以使用<code>interface</code>, <code>annotation</code> 和 <code>enum</code>关键字。 </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line"><span class="keyword">abstract</span> <span class="class"><span class="keyword">class</span> <span class="title">AbstractList</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">abstract</span> <span class="title">AbstractCollection</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">interface</span> <span class="title">List</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">interface</span> <span class="title">Collection</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line"><span class="class"></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">List</span> &lt;|-- <span class="title">AbstractList</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">Collection</span> &lt;|-- <span class="title">AbstractCollection</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">10</span></pre></td><td class="code"><pre><span class="line"><span class="class"></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">11</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">Collection</span> &lt;|- <span class="title">List</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">12</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">AbstractCollection</span> &lt;|- <span class="title">AbstractList</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">13</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">AbstractList</span> &lt;|-- <span class="title">ArrayList</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">14</span></pre></td><td class="code"><pre><span class="line"><span class="class"></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">15</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">class</span> <span class="title">ArrayList</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">16</span></pre></td><td class="code"><pre><span class="line">  Object[] elementData</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">17</span></pre></td><td class="code"><pre><span class="line">  size()</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">18</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">19</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">20</span></pre></td><td class="code"><pre><span class="line"><span class="keyword">enum</span> TimeUnit &#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">21</span></pre></td><td class="code"><pre><span class="line">  DAYS</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">22</span></pre></td><td class="code"><pre><span class="line">  HOURS</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">23</span></pre></td><td class="code"><pre><span class="line">  MINUTES</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">24</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">25</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">26</span></pre></td><td class="code"><pre><span class="line">annotation SuppressWarnings</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">27</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">28</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<h5 id="抽象与静态"><a href="#抽象与静态" class="headerlink" title="抽象与静态"></a>抽象与静态</h5><p> 通过修饰符<code>{static}</code>或者<code>{abstract}</code>，可以定义静态或者抽象的方法或者属性。 </p>
<p> 这些修饰符可以写在行的开始或者结束。也可以使用<code>{classifier}</code>这个修饰符来代替<code>{static}</code>. </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Dummy</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">  &#123;<span class="keyword">static</span>&#125; String id</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line">  &#123;<span class="keyword">abstract</span>&#125; <span class="function"><span class="keyword">void</span> <span class="title">methods</span><span class="params">()</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line"><span class="function">&#125;</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"><span class="function">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<p> PlantUML默认自动将方法和属性重新分组，可以自己定义分隔符来重排方法和属性，以下的分隔符都是可用的：–，.. ，== ，__  ，还可以在分隔符中添加标题： </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo1</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">  You can use</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line">  several lines</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">  ..</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line">  as you want</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line">  and group</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line">  ==</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line">  things together.</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">10</span></pre></td><td class="code"><pre><span class="line">  __</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">11</span></pre></td><td class="code"><pre><span class="line">  You can have as many groups</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">12</span></pre></td><td class="code"><pre><span class="line">  as you want</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">13</span></pre></td><td class="code"><pre><span class="line">  --</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">14</span></pre></td><td class="code"><pre><span class="line">  End of <span class="class"><span class="keyword">class</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">15</span></pre></td><td class="code"><pre><span class="line"><span class="class">&#125;</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">16</span></pre></td><td class="code"><pre><span class="line"><span class="class"></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">17</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">class</span> <span class="title">User</span> </span>&#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">18</span></pre></td><td class="code"><pre><span class="line">  .. Simple Getter ..</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">19</span></pre></td><td class="code"><pre><span class="line">  + getName()</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">20</span></pre></td><td class="code"><pre><span class="line">  + getAddress()</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">21</span></pre></td><td class="code"><pre><span class="line">  .. Some setter ..</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">22</span></pre></td><td class="code"><pre><span class="line">  + setName()</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">23</span></pre></td><td class="code"><pre><span class="line">  __ <span class="keyword">private</span> data __	<span class="comment">//添加标题</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">24</span></pre></td><td class="code"><pre><span class="line">  <span class="keyword">int</span> age</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">25</span></pre></td><td class="code"><pre><span class="line">  -- encrypted --</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">26</span></pre></td><td class="code"><pre><span class="line">  String password</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">27</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">28</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">29</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<h5 id="指定包"><a href="#指定包" class="headerlink" title="指定包"></a>指定包</h5><p>可以通过关键词 <code>package</code> 声明包，同时可选的来声明对应的背景色（通过使用html色彩代码或名称）。 </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">package "Classic Collections" #DDDDDD &#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line">  Object &lt;|-- ArrayList</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line"><span class="keyword">package</span> net.sourceforge.plantuml &#123;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line">  Object &lt;|-- Demo1</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line">  Demo1 *- Demo2</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">10</span></pre></td><td class="code"><pre><span class="line">&#125;</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">11</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">12</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<p><img src="https://s.plantuml.com/imgw/class-diagram-dlkb0dnq.webp" alt=""></p>
<h5 id="添加备注和模板"><a href="#添加备注和模板" class="headerlink" title="添加备注和模板"></a>添加备注和模板</h5><ul>
<li><p>模板通过类关键字(“&lt;&lt;”和”&gt;&gt;”)来定义 </p>
</li>
<li><p>可以使用<code>note left of</code> , <code>note right of</code> , <code>note top of</code> , <code>note bottom of</code>这些关键字来添加备注。 </p>
</li>
<li><p>还可以在类的声明末尾使用<code>note left</code>, <code>note right</code>,<code>note top</code>, <code>note bottom</code>来添加备注。 </p>
</li>
<li><p>单独用<code>note</code>这个关键字也是可以的，使用 <code>..</code> 符号可以作出一条连接它与其它对象的虚线。 </p>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Object</span> &lt;&lt; <span class="title">general</span> &gt;&gt;</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="title">Object</span> &lt;|--- <span class="title">ArrayList</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line"><span class="class"></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">note top of Object : In java, every class\nextends this one.</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">7</span></pre></td><td class="code"><pre><span class="line">note <span class="string">"This is a floating note"</span> as N1</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">8</span></pre></td><td class="code"><pre><span class="line">note <span class="string">"This note is connected\nto several objects."</span> as N2</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">9</span></pre></td><td class="code"><pre><span class="line">Object .. N2</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">10</span></pre></td><td class="code"><pre><span class="line">N2 .. ArrayList</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">11</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">12</span></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo</span></span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">13</span></pre></td><td class="code"><pre><span class="line">note left: On last defined class</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">14</span></pre></td><td class="code"><pre><span class="line"></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">15</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>

<p><img src="https://s.plantuml.com/imgw/class-diagram-ym813clr.webp" alt=""></p>
<h5 id="改变箭头方向"><a href="#改变箭头方向" class="headerlink" title="改变箭头方向"></a>改变箭头方向</h5><p> 类之间默认采用两个破折号 <code>--</code> 显示出垂直 方向的线. 要得到水平方向的可以像这样使用单破折号 (或者点): </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line">Room o- Student</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">Room *-- Chair</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<p> 也可以通过改变倒置链接来改变方向 </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line">Student -o Room</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">Chair --* Room</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<p> 也可通过在箭头内部使用关键字， 例如<code>left</code>, <code>right</code>, <code>up</code> 或者 <code>down</code>，来改变方向 </p>
<blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@startuml</span></span></pre></td></tr><tr><td class="gutter"><pre><span class="line">2</span></pre></td><td class="code"><pre><span class="line">foo -left-&gt; dummyLeft </span></pre></td></tr><tr><td class="gutter"><pre><span class="line">3</span></pre></td><td class="code"><pre><span class="line">foo -right-&gt; dummyRight </span></pre></td></tr><tr><td class="gutter"><pre><span class="line">4</span></pre></td><td class="code"><pre><span class="line">foo -up-&gt; dummyUp </span></pre></td></tr><tr><td class="gutter"><pre><span class="line">5</span></pre></td><td class="code"><pre><span class="line">foo -down-&gt; dummyDown</span></pre></td></tr><tr><td class="gutter"><pre><span class="line">6</span></pre></td><td class="code"><pre><span class="line"><span class="meta">@enduml</span></span></pre></td></tr></table></figure>
</blockquote>
<p><img src="https://s.plantuml.com/imgw/class-diagram-f9tbsmlt.webp" alt=""></p>
<h4 id="二、类之间关系的详解"><a href="#二、类之间关系的详解" class="headerlink" title="二、类之间关系的详解"></a>二、类之间关系的详解</h4><ol>
<li><p>泛化（Generalization） </p>
<p>【泛化关系】：是一种<strong>继承关系</strong>，表示一般与特殊的关系，它指定了子类如何特化父类的所有特征和行为。例如：老虎是动物的一种，即有老虎的特性也有动物的共性。</p>
<p>【箭头指向】：带三角箭头的实线，箭头指向父类</p>
</li>
<li><p>实现（Realization） </p>
<p>【实现关系】：是一种<strong>类与接口的关系</strong>，表示类是接口所有特征和行为的实现.</p>
<p>【箭头指向】：带三角箭头的虚线，箭头指向接口</p>
</li>
<li><p>关联（Association) </p>
<p>【关联关系】：<strong>是一种拥有的关系，它使一个类知道另一个类的属性和方法</strong>；如：老师与学生，丈夫与妻子关联可以是双向的，也可以是单向的。双向的关联可以有两个箭头或者没有箭头，单向的关联有一个箭头。</p>
<p>【代码体现】：成员变量</p>
<p>【箭头及指向】：带普通箭头的实心线，指向被拥有者</p>
</li>
<li><p>聚合（Aggregation）<br>【聚合关系】：是整体与部分的关系，且<strong>部分可以离开整体而单独存在</strong>。如车和轮胎是整体和部分的关系，轮胎离开车仍然可以存在。</p>
<p><strong>聚合关系是关联关系的一种，是强的关联关系；关联和聚合在语法上无法区分，必须考察具体的逻辑关系。</strong></p>
<p>【代码体现】：成员变量</p>
<p>【箭头及指向】：带空心菱形的实心线，菱形指向整体</p>
</li>
<li><p>组合(Composition)<br>【组合关系】：是整体与部分的关系，但<strong>部分不能离开整体而单独存在</strong>。如公司和部门是整体和部分的关系，没有公司就不存在部门。</p>
<p> <strong>组合关系是关联关系的一种</strong>，是比聚合关系还要强的关系，它要求普通的聚合关系中代表整体的对象负责代表部分的对象的生命周期。</p>
<p>【代码体现】：成员变量</p>
<p>【箭头及指向】：带实心菱形的实线，菱形指向整体</p>
</li>
<li><p>依赖(Dependency)<br>【依赖关系】：是一种<strong>使用的关系</strong>，即一个类的实现需要另一个类的协助，所以要<strong>尽量不使用双向的互相依赖.</strong></p>
<p>【代码表现】：局部变量、方法的参数或者对静态方法的调用</p>
<p>【箭头及指向】：带箭头的虚线，指向被使用者</p>
</li>
</ol>
<blockquote>
<p> 各种关系的强弱顺序：    泛化 = 实现 &gt; 组合 &gt; 聚合 &gt; 关联 &gt; 依赖 </p>
</blockquote>
<p>完整示例:</p>
<p><img src="http://a1.qpic.cn/psc?/V14N9n6L1YfzpS/7o.xLwnHK.dZGyBaILrm9xDzVMHaUNZg7.kBOION*sjftXZdZAFeWiaeGMCm0XMvPNQYtTYgTMIaxfu6azHUmYutctME4wkB.QqMz6tPMJM!/c&ek=1&kp=1&pt=0&bo=GgOFAgAAAAADF6w!&tl=1&vuin=1323807496&tm=1576483200&sce=60-2-2&rf=viewer_4" alt=""></p>
<p>​    </p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/blog/tags/UML%E7%B1%BB%E5%9B%BE/" rel="tag"><i class="fa fa-tag"></i> UML类图</a>
              <a href="/blog/tags/%E5%B7%A5%E5%85%B7/" rel="tag"><i class="fa fa-tag"></i> 工具</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2019/12/09/mysql%E5%9F%BA%E7%A1%80%E6%9E%B6%E6%9E%84/" rel="prev" title="mysql基础架构">
      <i class="fa fa-chevron-left"></i> mysql基础架构
    </a></div>
      <div class="post-nav-item">
    <a href="/blog/2019/12/24/%E7%AC%AC%E4%B8%89%E7%AB%A0-%E4%B8%AD%E6%96%87%E7%BC%96%E7%A0%81%E9%97%AE%E9%A2%98/" rel="next" title="第三章 中文编码问题">
      第三章 中文编码问题 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#plantUML插件安装"><span class="nav-number">1.</span> <span class="nav-text">plantUML插件安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#一、UML类图的简单绘制"><span class="nav-number">2.</span> <span class="nav-text">一、UML类图的简单绘制</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#类之间的关系表示："><span class="nav-number">2.1.</span> <span class="nav-text">类之间的关系表示：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#添加方法："><span class="nav-number">2.2.</span> <span class="nav-text">添加方法：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#定义可访问性"><span class="nav-number">2.3.</span> <span class="nav-text">定义可访问性</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#抽象类与接口"><span class="nav-number">2.4.</span> <span class="nav-text">抽象类与接口</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#抽象与静态"><span class="nav-number">2.5.</span> <span class="nav-text">抽象与静态</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#指定包"><span class="nav-number">2.6.</span> <span class="nav-text">指定包</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#添加备注和模板"><span class="nav-number">2.7.</span> <span class="nav-text">添加备注和模板</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#改变箭头方向"><span class="nav-number">2.8.</span> <span class="nav-text">改变箭头方向</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#二、类之间关系的详解"><span class="nav-number">3.</span> <span class="nav-text">二、类之间关系的详解</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Durian"
      src="/blog/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Durian</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/blog/tags/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/Durianyang" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Durianyang" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:1323807496@qq.com" title="E-Mail → mailto:1323807496@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        


<div class="copyright">
  
  &copy; 2019 – 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Durian</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    <span title="站点总字数">18k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">16 分钟</span>
</div>
<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.0.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.6.0
  </div>
-->

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共7.4k字</span>
</div>

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>
<script src="/blog/js/utils.js"></script><script src="/blog/js/motion.js"></script>
<script src="/blog/js/schemes/pisces.js"></script>
<script src="/blog/js/next-boot.js"></script>



  




  <script src="/blog/js/local-search.js"></script>












  

  

</body>
</html>
